﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Chromos.ActionEngine;
using Chromos.AIEngine;

namespace Chromos.Actors
{
	class FireMonster : Enemy
    {
        const int moveSpeed = 80;

        public FireMonster(Game1 game, Vector2 position, Vector2 velocity, ContentManager content, bool isStatic, string aggressiveness)
			: base(game, position, velocity, content, isStatic,  aggressiveness)
		{
			this.applyGravity = true;
		}

        protected override void initAIEngine()
		{
			aiEngine = new ActorAIEngine(this, "normal", 300);
		}

		protected override void initActorFields()
		{
			base.initActorFields();
			this.health = 100;
		}

		public override Projectile createProjectiles(int i)
		{
			return null;
		}

		public override void addActions()
		{
            // Create and add the various actions for this actor's idling, movement, attack, and defense.
            // NOTE: Uses VisualLoopingAction until VisualNonLoopingAction is made non-abstract.

            // FireMonster Idle (nonLooping)
			IdleAction standing = new IdleAction(this, content, Vector2.Zero, ForceType.ForceInstant, 0);
            standing.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/FireStanding");


            // FireMonster Move Left
            WalkAction moveLeft = new WalkAction(this, content, new Vector2(-moveSpeed, 0), ForceType.ForceContinuous, 50, FACING.LEFT);
            moveLeft.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/Move/FireMoveLeft1");
            moveLeft.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/Move/FireMoveLeft2");
            moveLeft.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/Move/FireMoveLeft3");

            // FireMonster Move Right
            WalkAction moveRight = new WalkAction(this, content, new Vector2(moveSpeed, 0), ForceType.ForceContinuous, 50, FACING.RIGHT);
            moveRight.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/Move/FireMoveRight1");
            moveRight.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/Move/FireMoveRight2");
            moveRight.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/Move/FireMoveRight3");

            // FireMonster Jump Left (nonLooping)
            JumpAction jumpLeft = new JumpAction(this, content, new Vector2(0, -moveSpeed), ForceType.ForceContinuous, 0);
            jumpLeft.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/Jump/FireJumpLeft");

            // FireMonster Jump Right (nonLooping)
            JumpAction jumpRight = new JumpAction(this, content, new Vector2(0, -moveSpeed), ForceType.ForceContinuous, 0);
            jumpRight.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Move/Jump/FireJumpRight");


            // FireMonster Attack Left (nonLooping)
			AttackAction attackLeft = new AttackAction(this, content, Vector2.Zero, ForceType.ForceInstant, 50, createProjectiles, 0, 0, 0, 500, 0, 0, 0, null, null, FACING.LEFT, false);
            attackLeft.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Attecks/FlameLeft1");
            attackLeft.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Attecks/FlameLeft2");
            attackLeft.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Attecks/FlameLeft3");
            attackLeft.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Attecks/FlameLeft4");

            // FireMonster Attack Right (nonLooping)
			AttackAction attackRight = new AttackAction(this, content, Vector2.Zero, ForceType.ForceInstant, 50, createProjectiles, 0, 0, 0, 500, 0, 0, 0, null, null, FACING.RIGHT, false);
            attackRight.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Attecks/FlameRight1");
            attackRight.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Attecks/FlameRight2");
            attackRight.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Attecks/FlameRight3");
            attackRight.addImageToLoad(@"Sprites/Enemies/RedUnits/FireMonster/Attecks/FlameRight4");


			// Add everything to the correct action list
			actionEngine.addIdle(standing);
			actionEngine.addMovement(moveLeft);
			actionEngine.addMovement(moveRight);
			actionEngine.addMovement(jumpLeft);
			actionEngine.addMovement(jumpRight);
            actionEngine.addAttack(attackLeft);
            actionEngine.addAttack(attackRight);
		}
    }
}
